#ifndef DEXIOSFMTAB_H
#define DEXIOSFMTAB_H

#include <QWidget>

class QAbstractItemModel;
class QComboBox;
class QFileSystemModel;
class QMenu;
class QModelIndex;
class QSortFilterProxyModel;
class QToolBar;
class QTreeView;
class QVBoxLayout;

class DexiosFMTab : public QWidget
	{
		Q_OBJECT

		public:
			DexiosFMTab(QAbstractItemModel *, QWidget * = 0, Qt::WindowFlags = 0);

			QModelIndex currentIndex() const;
			QModelIndex firstImage();
			bool isItemSelected();
			QModelIndex lastImage();
			QModelIndex nextImage();
			QModelIndex previousImage();
			QModelIndex rootIndex() const;

			QTreeView * view() const
				{
					return dir_view;
				}

		private:
			QMenu * back_history;
			QTreeView * dir_view;
			QFileSystemModel * file_system;
			QMenu * forward_history;
			QVBoxLayout * layout;
			QComboBox * location_box;
			QToolBar * main_toolbar;
			QSortFilterProxyModel * proxy_file_system;
			QString trash_bin;

		public slots:
			void goUp();
			void openPath();
			void openPath(const QString &);
			void openPath(const QModelIndex &, bool = true);

		protected slots:
			void emitActionSignalsItemClicked(const QModelIndex &);

		signals:
			void currentPathChanged(DexiosFMTab *, const QString &);
			void enableAddToFavorites(bool);
			void enableDeleteAction(bool);
			void enableGoBackAction(bool);
			void enableGoForwardAction(bool);
			void enableGoUpAction(bool);
			void enableNewDirAction(bool);
			void enableRenameAction(bool);
			void previewImage();
	};

#endif // DEXIOSFMTAB_H
